{% extends "base.html" %}

{% block content %}
</form>

<form method="post" action="sendmail.php">
	<div id="newmail">
		<p id="basicheader">
			<label for="from">From</label>
			<input type="text" name="from" id="from" value="{{ from }}" /><br />

			<label for="to">To</label>
			<input type="text" name="to" id="to" value="{{ to }}" /><br />

			<label for="cc">Cc</label>
			<input type="text" name="cc" id="cc" value="{{ cc }}" /><br />

			<label for="bcc">Bcc</label>
			<input type="text" name="bcc" id="bcc" value="{{ bcc }}" /><br />

			<label for="subject">Subject</label>
			<input type="text" name="subject" id="subject" value="{{ subject }}" /><br />

			<label for="headers">Additional headers</label><a href="#" id="toggleheaders">Show</a><br />
			<div id="headerswrap" class="hideonload">
				These headers are passed "as is", with no further processing. Use carefully.<br />
				<textarea name="headers" id="headers" rows="7" cols="78">{{ headers }}</textarea>
			</div>
		</p>

		<p>
			<label for="mailbody">Body</label><br />
			<textarea name="body" id="mailbody" rows="25" cols="78" wrap="hard">{{ body|raw }}</textarea>
		</p>

		<p>
			<input type="submit" value="Send mail" />
		</p>
	</div>
</form>

<form method="post" action="{{ phpself }}">

{% endblock %}
{% block afterjs %}

<script>
	AddEvent(window, 'load', Textarea);
	AddEvent(document.getElementById('toggleheaders'), 'click', ToggleHeaders);
</script>

{% endblock %}
